#include <iostream>
using namespace std;

//枚举
enum class color_first
{
	RED,
	GREEN,
	BLUE
};
//enum  color_second
//{
//	RED = 1,
//	GREEN,
//	BLUE
//};

void func(test_one::meiju a)
{
    cout << typeid(a).name() << endl; //变量a的类型为enum test_one::meiju
}

//继承中的隐藏
class Parent
{
public:
	Parent(int a)
		:_a(a)
	{}
	void func()
	{
		cout << "Parent" <<_a<< endl;
	}
protected:
	int _a;
};

class Child :public Parent
{
public:
	Child(int parent_a,int a)
		:Parent(parent_a) //没有默认构造函数的自定义类型对象必须在初始化列表初始化
		,_a(a)
	{}
	void func()
	{
		cout << "Parent::_a = " << Parent::_a << endl << "Child::_a = " << _a << endl;
		Parent::func();
	}
private:
	int _a;
};
int main()
{
	enum color_first cf = color_first::RED;//访问enum class类型的枚举必须指定作用域

	Child c(1,2);
	c.func();
	/*int a = 2;
	switch (a)
	{
	case 1:
	{
		cout << "1" << endl;
		break;
	}
	case 2:
	{
		cout << "2" << endl;
		break;
	}
	default:
	{
		break;
	}
	}*/
	return 0;
}



class Parent1
{
public:
	void func()
	{

	}
	typedef int typeInt;
};
class Child1 : public Parent1
{
public:
	//using Parent1::func;//using 可以将基类的成员引入到子类作用域中，解决隐藏问题
	using Parent1::typeInt;
	void func(int i)
	{

	}
};

int main()
{
	Child1 child1;
	child1.Parent1::func(); //如果不使用using的话那么就无法通过child1.func()访问
	Child1::typeInt t = 1;
    return 0;
}